package com.shuogg.transaction.service;

import com.shuogg.transaction.model.User;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface UserService {
    long add(User user);

    void update(User user);

    void delete(Long id);

    List<User> listAll();

    Long count();

    Long countBy(String field, Object value);

    void deleteBy(String field, Object value);

    User get(Long id);

    void batchDelete(List<Long> idList);

    User getBy(String field, Object value);

    User getByAnd(String field1, Object value1, String field2, Object value2);

    User getByOr(String field1, Object value1, String field2, Object value2);

    List listBy(String field, Object value);

    List<User> listByAnd(String field1, Object value1, String field2, Object value2);

    List<User> listByOr(String field1, Object value1, String field2, Object value2);

    Long addTest();

    void doInnerTransaction();

    void doNoTransaction();

    @Transactional
    void tdoInnerTransaction();
}
